home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Games / Game Sample Code / ZAM 1.0a13 / CoreSource / Document.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-16  |  1.6 KB  |  115 lines  |  [TEXT/KAHL]

  1. #include "CoreGlobals.h"
  2. #include "ZAM.h"
  3. #include "MenuDispatch.h"
  4.  
  5.  
  6. //#define NETWORK_HELL 1
  7.  
  8. void UpdateGameWindow(WindowPtr graf, gamePtr game)
  9. {
  10.     SpriteUpdateEvent();
  11. }
  12.  
  13. void OpenGameWindow(WindowPtr    wp, gamePtr game)
  14. {
  15. }
  16.  
  17. void CloseGameWindow(WindowPtr wp, gamePtr game)
  18. {
  19. }
  20.  
  21. void SaveGameWindow(WindowPtr    wp, gamePtr game)
  22. {
  23. }
  24.  
  25. void ClickGameWindow(WindowPtr wp, gamePtr game)
  26. {
  27.  
  28. #if 0
  29.     Point        click;
  30.     short        dir;
  31.     GrafPtr        savePort;
  32.     fixPt        vel;
  33.     Fixed        velH,velV;
  34.     
  35.     GetPort(&savePort);
  36.     SetPort(wp);
  37.     
  38.     click = gEvent.where;
  39.     GlobalToLocal(&click);
  40.     
  41.     dir = Random() % kNumShotFrames;
  42.     if(dir < 0) dir = -dir;
  43.  
  44.     //StartExplosionHere(game, ff(click.h), ff(click.v));
  45.  
  46.  
  47.     FireMissile( dir, ff(click.h), ff(click.v), false);
  48.  
  49.     {
  50.         short    i;
  51.         for(i = 0; i < 10; i++) {
  52.             dir += i;
  53.             if(dir >= kNumShotFrames) dir = 0;
  54.             FireMissile( dir, ff(click.h), ff(click.v), false);
  55.  
  56.         }
  57.  
  58.         for(i = 0; i < 5; i++) {
  59.             dir += i;
  60.             if(dir >= kNumShotFrames) dir = 0;
  61.             FireMissile( dir, ff(click.h), ff(click.v), false);
  62.         }
  63.  
  64.  
  65.     }
  66.  
  67.     SetPort(savePort);
  68.  
  69. #endif
  70.     
  71. #ifdef NETWORK_HELL
  72.     FireNetworkMissile(game, dir, click);
  73. #endif
  74. }
  75.  
  76. void KeyGameWindow(WindowPtr wp, gamePtr game)
  77. {
  78. }
  79.  
  80. void AdjustMenuGameWindow(WindowPtr wp, gamePtr game)
  81. {
  82. }
  83.  
  84. void IdleGameWindow(void)
  85. {
  86.     
  87.     ProcessXThingTask(10);
  88.     CheckMissileColissions(gGame);
  89.     AnimateSprites();
  90.     SoundKeeper();
  91.     CheckTankDead();
  92. }
  93.  
  94. void NewGameWindow(void)
  95. {
  96.     NewGame();
  97. }
  98.  
  99.  
  100. void ForceRefreshGameWindow(WindowPtr wp, gamePtr game)
  101. {
  102.     GrafPtr        savePort;
  103.  
  104.     GetPort(&savePort);
  105.     SetPort(wp);
  106.  
  107.     ValidRect(&wp->portRect);
  108.     UpdateGameWindow(wp, game);
  109.  
  110.     SetPort(savePort);
  111.  
  112.  
  113. }
  114.  
  115.